#include "stdafx.h"
#include "EDCFactor.h"
EDCFactor::EDCFactor() :
m_area(0), m_interval(0)
{
}
EDCFactor::EDCFactor(const double& area, const unsigned int interval) :
m_area(area), m_interval(interval)
{
	factor();
}

bool EDCFactor::interval(const unsigned int& input)
{
	m_interval = input;
	return factor();
}
bool EDCFactor::area(const double& input)
{
	m_area = input;
	return factor();
}
const double EDCFactor::operator()(const double& rhs)
{
    return rhs*m_factor;
}
bool EDCFactor::factor()
{
    if (( m_area == 0) || ( m_interval == 0)) // error defense
        return false;

	m_factor=(mm2m)*
		(
        (m_area*squarekm2squarem)/
        (m_interval*minute2second)
        );
	return true;
}